package com.sky.mapper;

import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {
    /*
    * 根据dishId 查看 CategoryId
    * */
    List<Long> getSetmealIdsByDishIds(List<Long> dishIds);

    /*
     * 新增套餐
     * @param
     */
    void insertBatch(List<SetmealDish> setmealDishes);


    @Delete("delete from setmeal_dish where setmeal_id=#{setmealId}")
    void deleteBySetmealId(Long id);

    /*
    * 根据Setmealid 查询套餐关联的菜品
    * */
    @Select("select * from setmeal_dish where setmeal_id=#{id}")
    List<SetmealDish> getBySetmealId(Long id);
}
